#pragma once
#include "util.h"
#include "BinaryReader.h"
#include "Animation.h"
#include "StoredAnimationNode.h"
#include "DAEFloat4.h"
/**
* This class reads animations that are stored in a binary file.
* The header of the file is :
* 1) the magic number 0x0DAEBABE
* 2) the name of the animation
* 3) start frame as an unsigned 4 byte integer
* 4) end frame as an unsiged 4 byte integer
* @author Koen Samyn
*/
class BinAnimationReader:public BinaryReader
{
public:
	/**
	* Creates a new BinAnimationReader object.
	*/
	BinAnimationReader(tstring filename);
	/**
	* Destroys the BinAnimationReader object.
	*/
	virtual ~BinAnimationReader(void);
	/**
	* Reads the binary file
	*/
	bool Read();
	/**
	* Returns the animation object that was read.
	* @return the Animation object
	*/
	Animation* GetAnimation() const
	{
		return m_pAnimation;
	}
private:
	/**
	* Check for the magic number.
	*/
	int m_Header;
	/**
	* The resulting animation object.
	*/
	Animation* m_pAnimation;
	/**
	* The current animation node.
	*/
	StoredAnimationNode* m_pStoredAnimationNode;
	/**
	* The current time
	*/
	unsigned int m_CurrentTime;

	// -------------------------
	// Disabling default copy constructor and default assignment operator.
	// If you get a linker error from one of these functions, your class is internally trying to use them. This is
	// an error in your class, these declarations are deliberately made without implementation because they should never be used.
	// -------------------------

	BinAnimationReader(const BinAnimationReader& t);
	BinAnimationReader& operator=(const BinAnimationReader& t);
};
